package org.fs;

import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.fs.dao.AirportHome;
import org.fs.entities.Airport;

public class AirportAbbreviationMap implements Map<String, Airport> {
	
	private AirportHome airportHome;
	private Map<String, Airport> map = new HashMap<String, Airport>();
	
	public void init(){
		List<Airport> airports = airportHome.getAll();
		for (Airport airport : airports) {
			map.put(airport.getAbbreviation(), airport);
		}
	}

	public void clear() {
		map.clear();
		
	}

	public boolean containsKey(Object key) {
		return map.containsKey(key);
	}

	public boolean containsValue(Object value) {
		return map.containsValue(value);
	}

	public Set<java.util.Map.Entry<String, Airport>> entrySet() {
		return map.entrySet();
	}

	public Airport get(Object key) {
		return map.get(key);
	}

	public boolean isEmpty() {
		return map.isEmpty();
	}

	public Set<String> keySet() {
		return map.keySet();
	}

	public Airport put(String key, Airport value) {
		return map.put(key, value);
	}

	public void putAll(Map<? extends String, ? extends Airport> t) {
		map.putAll(t);
		
	}

	public Airport remove(Object key) {
		return map.remove(key);
	}

	public int size() {
		return map.size();
	}

	public Collection<Airport> values() {
		return map.values();
	}

	public void setAirportHome(AirportHome airportHome) {
		this.airportHome = airportHome;
	}

}
